package itsm.isperp.job;

import itsm.isperp.module.service.slm.SlmCalculateService;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 
 * SLM服务计算作业,调整所有计算的状态，及slm时间。建议运行间隔设置为300秒以上。
 * 
 * @author lizx
 * @date 2013-7-31
 * 
 */
@Service
public class SlmServiceAllElapsedJob implements Job {

	public static final Logger logger = LoggerFactory
			.getLogger(SlmServiceAllElapsedJob.class);

	@Autowired
	protected SlmCalculateService slmCalculateService;

	@Override
	public void execute(JobExecutionContext context)
			throws JobExecutionException {
		logger.info("generate plan task.");
		slmCalculateService.updateAllWorktime();
	}
}
